/* ===== Global CSS for the entire website ===== */

/* ===== VARIABLES & BASE STYLES ===== */

/* CSS variables for colors, transition timing, and theme consistency */
:root {
  --primary-color: #ff4d4d;          /* Main accent color */
  --secondary-color: #1a1a1a;        /* Secondary dark color for backgrounds, etc. */
  --text-color: #f5f5f5;             /* Default text color */
  --bg-color: #0d0d0d;               /* Body background color */
  --card-bg: #1a1a1a;                /* Background color for cards or panels */
  --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Smooth animation */
}

/* Reset default styles, apply consistent box-sizing and font */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  border: none;
  outline: none;
  font-family: 'Poppins', sans-serif;
}

/* Base html settings: root font size for rem scaling and smooth scrolling */
html {
  font-size: 62.5%;                  /* 1rem = 10px for easier calculations */
  scroll-behavior: smooth;           /* Smooth scroll for anchor links */
  scroll-padding-top: 8rem;          /* Offset for fixed header */
}

/* Base body styling */
body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;                /* Prevent horizontal scroll */
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;                  /* Default line spacing */
}


/* ===== HEADER (matches <header> in HTML) ===== */

/* Fixed top header with padding, flex layout, and blur background */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 2.5rem 9% 2.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  background-color: transparent;     /* Transparent by default, changes on scroll */
}

/* Header styling when scrolled: background color, shadow, reduced padding */
header.scrolled {
  background-color: rgba(10, 10, 10, 0.95);
  box-shadow: 0 0.5rem 1.5rem rgba(255, 77, 77, 0.15);
  padding: 1.5rem 9%;
}


/* ===== LOGO (matches <a class="logo">) ===== */

/* Logo container alignment */
.logo {
  display: flex;
  align-items: center;
  height: 7rem;
}

/* Logo image styling: size, padding, background, shadow */
.logo img {
  height: 100%;
  width: auto;
  max-width: 150px;
  transition: var(--transition);
  object-fit: contain;
  border-radius: 12px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Hover effect for logo: scale up, increase border radius and shadow */
.logo:hover img {
  transform: scale(1.1);
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}


/* ===== NAVIGATION BAR (matches <nav>) ===== */

/* Navigation links layout */
.main_nav {
  display: flex;
  gap: 3.5rem;
}

/* Individual nav links styling */
.main_nav a {
  font-size: 1.7rem;
  color: var(--text-color);
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  padding: 0.5rem 0;
}

/* Underline effect for nav links */
.main_nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0.2rem;
  background: var(--primary-color);
  transition: var(--transition);
}

/* Expand underline on hover or when link is active */
.main_nav a:hover::after,
.main_nav a.active::after {
  width: 100%;
}

/* Change link color on hover or active */
.main_nav a:hover,
.main_nav a.active {
  color: var(--primary-color);
}

/* Hamburger menu toggle for small screens */
.menu-toggle {
  display: none;
  cursor: pointer;
  font-size: 2.8rem;
  color: var(--text-color);
  transition: var(--transition);
  z-index: 1001;
}

.menu-toggle:hover {
  color: var(--primary-color);
}



/* ===== RESPONSIVE DESIGN BREAKPOINTS ===== */

/* Slightly smaller base font for large tablets/desktops */
@media (max-width: 1200px) {
  html { font-size: 58%; }
}

/* Header padding adjustments for medium screens */
@media (max-width: 991px) {
  header { padding: 2rem 5%; }
  header.scrolled { padding: 1.5rem 5%; }
}

/* Small screens (tablets): show hamburger, slide-in nav, adjust logo size */
@media (max-width: 768px) {
  .menu-toggle { display: block; }

  .main_nav {
    position: fixed;
    top: 0;
    right: -100%;               /* hidden by default */
    width: 50%;
    height: 100vh;
    background-color: var(--secondary-color);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: right 0.5s ease;
    z-index: 1000;
    box-shadow: -0.5rem 0 1.5rem rgba(0, 0, 0, 0.2);
  }

  .main_nav.active { right: 0; }       /* Slide-in nav when active */

  .logo { height: 6rem; }
  .logo img { max-width: 150px; border-radius: 10px; }
}

/* Extra small screens (phones): smaller font, smaller logo */
@media (max-width: 480px) {
  html { font-size: 52%; }
  .logo { height: 4rem; }
  .logo img { max-width: 130px; border-radius: 8px; }
}
